package com.example.smartcity.ui.person

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.example.smartcity.logic.Repository
import com.example.smartcity.logic.model.LoginAll

class PersonViewModel : ViewModel() {
    /**
     * 获取用户信息
     */
    private val loginData = MutableLiveData<String>()
    val loginList = ArrayList<LoginAll.User>()
    val loginDataLive = Transformations.switchMap(loginData){str ->
        Repository.getLoginAll(str)
    }
    fun setLogin(token: String){
        loginData.value = token
    }
}